package com.itheima;

import com.itheima.config.SpringConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;
import java.sql.SQLException;

public class App {
    public static void main(String[] args) throws SQLException {
        //解析配置类.获得容器
        ApplicationContext app = new AnnotationConfigApplicationContext(SpringConfig.class);
        DataSource dataSource = app.getBean(DataSource.class);
        System.out.println(dataSource.getConnection().isClosed());
    }
}
